package com.zaprk.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @PackageName: com.zaprk.controller
 * @ClassName: NacosConfigController
 * @Description:
 * @author: RZS
 * @date: 2024/4/23  16:00
 */
@RestController
@RequestMapping("/config")
// 配置发布之后，动态刷新配置
@RefreshScope
public class NacosConfigController {

    @Value("${user.uname}")
    private String uname;

    @GetMapping("/test")
    public String test(){
        return uname;
    }

}
